<?php

if (!defined('MOODLE_INTERNAL')) {
    die('Direct access to this script is forbidden.');
}

global $CFG;
require_once($CFG->dirroot . '/blocks/formal_langs/parsers.php');

class block_formal_langs_parsers_test extends UnitTestCase {

    public function test_parser_constructor() {
        global $CFG;
        $parser_rules = file_get_contents($CFG->dirroot . '/blocks/formal_langs/simpletest/test_parser_rus.txt');
        $this->assertNotNull($parser_rules);
        $common_parser = new block_formal_langs_parser($parser_rules);
        $this->assertNotNull($common_parser);
        $this->assertIsA($common_parser, 'block_formal_langs_parser');
    }

}
 ?>